package net.lab1024.sa.admin.module.users.domain.form;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotBlank;
import lombok.Data;
import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;

/**
 * 实训室管理系统 新建表单
 *
 * @Author 王俊权
 * @Date 2024-11-06 10:32:24
 * @Copyright 🐂🐎bloc
 */

@Data
public class UsersAddForm {

    @Schema(description = "用户名，必须唯一", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户名，必须唯一 不能为空")
    private String username;

    @Schema(description = "用户密码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户密码 不能为空")
    private String password;

    @Schema(description = "用户角色，包括管理员、教师、学生", requiredMode = Schema.RequiredMode.REQUIRED)
    private int roleId;

    @Schema(description = "所属部门（对于教师和学生可能是所在系部等，管理员可能为空）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "所属部门（对于教师和学生可能是所在系部等，管理员可能为空） 不能为空")
    @JsonDeserialize(using = DictValueVoDeserializer.class)
    private String department;

    @Schema(description = "用户邮箱", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户邮箱 不能为空")
    private String email;

    @Schema(description = "用户电话", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户电话 不能为空")
    private String phone;

}